<?php
/**
 * Created by JetBrains PhpStorm.
 * User: FangXuanLing
 * Date: 13-11-21
 * Time: 上午10:15
 * To change this template use File | Settings | File Templates.
 */
?>

<div><a href="<?php echo Yii::app()->createUrl("admin/post/index")  ?>">返回</a> </div>
<div>
    <form action="<?php echo Yii::app()->createUrl("admin/post/edit")  ?>" method="POST">
        <table>
            <tr>
                <td width="100">标题：</td>
                <td>
                    <input type="text" name="title" value="<?php echo $p->title ?>"  style="width:350px;"/>
                    <input type="hidden" name="id" value="<?php echo $p->id ?>"/>
                </td>
            </tr>
            <tr>
                <td>分类：</td>
                <td>
                    <select name="cid">
                        <?php foreach($cate as $c) { ?>
                            <?php if($c->cid == $p->cid) {?>
                                <option value="<?php echo $c->cid ?>" selected="true"><?php echo $c->category_name ?></option>
                            <?php }else{ ?>
                                <option value="<?php echo $c->cid ?>"><?php echo $c->category_name ?></option>
                            <?php } ?>
                        <?php } ?>
                    </select>
                </td>
            </tr>
            <tr>
                <td>内容：</td>
                <td>
                    <textarea cols="10" rows="30" name="content">
                        <?php echo $p->content ?>
                    </textarea>
                </td>
            </tr>
            <tr>
                <td>tags:</td>
                <td><input type="text" name="tags" value="<?php echo $p->tags ?>" /></td>
            </tr>
            <tr>
                <td>状态:</td>
                <td>
                    <select name="status">
                        <option <?php if($p->status == 1) echo "selected='true'"  ?> value="1">草稿</option>
                        <option <?php if($p->status == 2) echo "selected='true'"  ?> value="2">对外可见</option>
                        <option <?php if($p->status == 3) echo "selected='true'"  ?> value="3">已过期</option>
                        <option <?php if($p->status == 4) echo "selected='true'"  ?> value="4">已删除</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td><input type="submit" name="submit" value="Submit" /> </td>
                <td><a href="<?php echo Yii::app()->createUrl("admin/post/index")  ?>">返回</a> </td>
            </tr>
        </table>
    </form>

</div>